package com.tenbent.product.center.insures.bo;

import com.tenbent.product.base.bo.BizObject;
import com.tenbent.product.base.mybatis.annotations.TypeAlias;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * SKU信息
 *
 * @author Randy
 *
 *         Created by ThinkPad on 2017/8/21.
 */
@Entity
@Table(name = "pc_sku_info")
@TypeAlias("skuInfo")
public class SkuInfo extends BizObject {

	/** 产品ID **/
	@Column(name = "product_id")
	private Integer productId;

	/** 类型代码 **/
	@Column(name = "type_code")
	private String typeCode;

	/** 类型文本 **/
	@Column(name = "type_text")
	private String typeText;

	/** 值代码 **/
	@Column(name = "value_code")
	private String valueCode;

	/** 值文本 **/
	@Column(name = "value_text")
	private String valueText;

	public Integer getProductId() {
		return productId;
	}

	public void setProductId(Integer productId) {
		this.productId = productId;
	}

	public String getTypeCode() {
		return typeCode;
	}

	public void setTypeCode(String typeCode) {
		this.typeCode = typeCode;
	}

	public String getTypeText() {
		return typeText;
	}

	public void setTypeText(String typeText) {
		this.typeText = typeText;
	}

	public String getValueCode() {
		return valueCode;
	}

	public void setValueCode(String valueCode) {
		this.valueCode = valueCode;
	}

	public String getValueText() {
		return valueText;
	}

	public void setValueText(String valueText) {
		this.valueText = valueText;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		SkuInfo skuInfo = (SkuInfo) o;

		if (productId != null ? !productId.equals(skuInfo.productId) : skuInfo.productId != null)
			return false;
		if (typeCode != null ? !typeCode.equals(skuInfo.typeCode) : skuInfo.typeCode != null)
			return false;
		if (typeText != null ? !typeText.equals(skuInfo.typeText) : skuInfo.typeText != null)
			return false;
		if (valueCode != null ? !valueCode.equals(skuInfo.valueCode) : skuInfo.valueCode != null)
			return false;
		return valueText != null ? valueText.equals(skuInfo.valueText) : skuInfo.valueText == null;

	}

	@Override
	public int hashCode() {
		int result = productId != null ? productId.hashCode() : 0;
		result = 31 * result + (typeCode != null ? typeCode.hashCode() : 0);
		result = 31 * result + (typeText != null ? typeText.hashCode() : 0);
		result = 31 * result + (valueCode != null ? valueCode.hashCode() : 0);
		result = 31 * result + (valueText != null ? valueText.hashCode() : 0);
		return result;
	}

	@Override
	public String toString() {
		return "SkuInfo{" + "productId=" + productId + ", typeCode='" + typeCode + '\'' + ", typeText='" + typeText
				+ '\'' + ", valueCode='" + valueCode + '\'' + ", valueText='" + valueText + '\'' + '}';
	}
}
